package demo428;

public class Car extends Bx {
    private double price;
    private int  number;
    private double money;
    //    String :引用数据类型。
    public Car(){
        System.out.println(1);
    }
    public Car(double price,int  number){
        this.price = price;
        this.number = number;
    }

    @Override
    public double add() {
//       计算保险费用

        if(number==0){
            money = price*0.02;
        }
        return money;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
}
